<?php

\vendor\illuminate\container\Container.php
$app->aliases 数组。

$aliases = [
    'app'                  => ['Illuminate\Foundation\Application', 'Illuminate\Contracts\Container\Container', 'Illuminate\Contracts\Foundation\Application'],
    'auth'                 => ['Illuminate\Auth\AuthManager', 'Illuminate\Contracts\Auth\Factory'],
    'auth.driver'          => ['Illuminate\Contracts\Auth\Guard'],
    'blade.compiler'       => ['Illuminate\View\Compilers\BladeCompiler'],
    'cache'                => ['Illuminate\Cache\CacheManager', 'Illuminate\Contracts\Cache\Factory'],
    'cache.store'          => ['Illuminate\Cache\Repository', 'Illuminate\Contracts\Cache\Repository'],
    'config'               => ['Illuminate\Config\Repository', 'Illuminate\Contracts\Config\Repository'],
    'cookie'               => ['Illuminate\Cookie\CookieJar', 'Illuminate\Contracts\Cookie\Factory', 'Illuminate\Contracts\Cookie\QueueingFactory'],
    'encrypter'            => ['Illuminate\Encryption\Encrypter', 'Illuminate\Contracts\Encryption\Encrypter'],
    'db'                   => ['Illuminate\Database\DatabaseManager'],
    'db.connection'        => ['Illuminate\Database\Connection', 'Illuminate\Database\ConnectionInterface'],
    'events'               => ['Illuminate\Events\Dispatcher', 'Illuminate\Contracts\Events\Dispatcher'],
    'files'                => ['Illuminate\Filesystem\Filesystem'],
    'filesystem'           => ['Illuminate\Filesystem\FilesystemManager', 'Illuminate\Contracts\Filesystem\Factory'],
    'filesystem.disk'      => ['Illuminate\Contracts\Filesystem\Filesystem'],
    'filesystem.cloud'     => ['Illuminate\Contracts\Filesystem\Cloud'],
    'hash'                 => ['Illuminate\Contracts\Hashing\Hasher'],
    'translator'           => ['Illuminate\Translation\Translator', 'Symfony\Component\Translation\TranslatorInterface'],
    'log'                  => ['Illuminate\Log\Writer', 'Illuminate\Contracts\Logging\Log', 'Psr\Log\LoggerInterface'],
    'mailer'               => ['Illuminate\Mail\Mailer', 'Illuminate\Contracts\Mail\Mailer', 'Illuminate\Contracts\Mail\MailQueue'],
    'auth.password'        => ['Illuminate\Auth\Passwords\PasswordBrokerManager', 'Illuminate\Contracts\Auth\PasswordBrokerFactory'],
    'auth.password.broker' => ['Illuminate\Auth\Passwords\PasswordBroker', 'Illuminate\Contracts\Auth\PasswordBroker'],
    'queue'                => ['Illuminate\Queue\QueueManager', 'Illuminate\Contracts\Queue\Factory', 'Illuminate\Contracts\Queue\Monitor'],
    'queue.connection'     => ['Illuminate\Contracts\Queue\Queue'],
    'queue.failer'         => ['Illuminate\Queue\Failed\FailedJobProviderInterface'],
    'redirect'             => ['Illuminate\Routing\Redirector'],
    'redis'                => ['Illuminate\Redis\Database', 'Illuminate\Contracts\Redis\Database'],
    'request'              => ['Illuminate\Http\Request', 'Symfony\Component\HttpFoundation\Request'],
    'router'               => ['Illuminate\Routing\Router', 'Illuminate\Contracts\Routing\Registrar'],
    'session'              => ['Illuminate\Session\SessionManager'],
    'session.store'        => ['Illuminate\Session\Store', 'Symfony\Component\HttpFoundation\Session\SessionInterface'],
    'url'                  => ['Illuminate\Routing\UrlGenerator', 'Illuminate\Contracts\Routing\UrlGenerator'],
    'validator'            => ['Illuminate\Validation\Factory', 'Illuminate\Contracts\Validation\Factory'],
    'view'                 => ['Illuminate\View\Factory', 'Illuminate\Contracts\View\Factory'],
];

首先说明：$aliases 数组中的 key，就是 $app->bindings 数组中的 key。


$this->aliases 数组中，key 是后面的每个元素，value 是前面的 key，以最后一个为例：
$this->aliases = [
...
'Illuminate\View\Factory' => 'view',
'Illuminate\Contracts\View\Factory' => 'view',
];



  以 'app'  => [
  'Illuminate\Foundation\Application',
  'Illuminate\Contracts\Container\Container',
  'Illuminate\Contracts\Foundation\Application'], 
  为例， 处理后就是
  $this->aliases['Illuminate\Foundation\Application'] = 'app';
  $this->aliases['Illuminate\Contracts\Container\Container'] = 'app';
  $this->aliases['Illuminate\Contracts\Foundation\Application'] = 'app';
  之前已经知道
  $this->instances 数组中存在 'app' 这个 key 的元素，值就是 $app。
  就基本就是依赖注入时具体找哪个对象了。